import {
    CallApi
} from './base';



export let ShopApi = {
    getShopList(data, cb) {
        CallApi('Report.asmx/SearchShopsInfo', data, cb)
    },
    getShopBaseData(data, cb) {
        CallApi('PlazaReport.asmx/weather', data, cb)
    },
    getSummary(data, cb) {
        if (data.flowDataType === 0) {
            CallApi('PlazaReport.asmx/summary', data, cb);
        } else if (data.flowDataType === 1 || data.flowDataType === 2) {
            CallApi('PlazaReport.asmx/AreaFlow', data, cb);
        } else {
            CallApi('PlazaReport.asmx/IndustryFlow', data, cb);
        }
    },
    getTrendAnalysisFlow(query, cb) {
        if (query.flowDataType === 0) {
            CallApi('PlazaReport.asmx/trendAnalysisFlow', query, cb);
        } else if (query.flowDataType === 1 || query.flowDataType === 2) {
            CallApi('PlazaReport.asmx/trendAnalysisAreaFlow', query, cb);
        } else if (query.flowDataType === 3) {
            CallApi('PlazaReport.asmx/trendAnalysisIndustryFlow', query, cb);
        }
    },
    getTrendAnalysisFlowByDay(query, cb) {
        if (query.flowDataType === 0) {
            CallApi('PlazaReport.asmx/data', query, cb);
        } else if (query.flowDataType === 1 || query.flowDataType === 2) {
            CallApi('PlazaReport.asmx/AreaDetailsFlow', query, cb);
        } else if (query.flowDataType === 3) {
            CallApi('PlazaReport.asmx/IndustryDetailsFlow', query, cb);
        }
    },
    getflowAveNumberData(query, cb) {
        if (query.flowDataType === 0) {
            CallApi('PlazaReport.asmx/averageFlow', query, cb);
        } else if (query.flowDataType === 1 || query.flowDataType === 2) {
            CallApi('PlazaReport.asmx/averageAreaFlow', query, cb);
        } else if (query.flowDataType === 3) {
            CallApi('PlazaReport.asmx/averageIndustryFlow', query, cb);
        }
    },
    getHolidayFlow(query, cb) {
        if (query.flowDataType === 0) {
            CallApi('PlazaReport.asmx/holidayFlow', query, cb);
        } else if (query.flowDataType === 1 || query.flowDataType === 2) {
            CallApi('PlazaReport.asmx/holidayAreaFlow', query, cb);
        } else if (query.flowDataType === 3) {
            CallApi('PlazaReport.asmx/holidayIndustryFlow', query, cb);
        }
    },
    getHolidayAvgPotentialFlowData(query, cb) {
        if (query.flowDataType === 0) {
            CallApi('PlazaReport.asmx/holidayAvgPotentialFlow', query, cb);
        } else if (query.flowDataType === 1 || query.flowDataType === 2) {
            CallApi('PlazaReport.asmx/holidayAvgPotentialAreaFlow', query, cb);
        } else if (query.flowDataType === 3) {
            CallApi('PlazaReport.asmx/holidayAvgPotentialIndustryFlow', query, cb);
        }
    },
    getTemperatureEChartData(query, cb) {
        if (query.flowDataType === 0) {
            CallApi('PlazaReport.asmx/temperatureFlow', query, cb);
        } else if (query.flowDataType === 1 || query.flowDataType === 2) {
            CallApi('PlazaReport.asmx/temperatureAreaFlow', query, cb);
        } else if (query.flowDataType === 3) {
            CallApi('PlazaReport.asmx/temperatureIndustryFlow', query, cb);
        }
    },
    getWeatherEChartData(query, cb) {
        if (query.flowDataType === 0) {
            CallApi('PlazaReport.asmx/weatherFlow', query, cb);
        } else if (query.flowDataType === 1 || query.flowDataType === 2) {
            CallApi('PlazaReport.asmx/weatherAreaFlow', query, cb);
        } else if (query.flowDataType === 3) {
            CallApi('PlazaReport.asmx/weatherIndustryFlow', query, cb);
        }
    },
    getEntranceExitFlowData(query, cb) {
        CallApi('PlazaReport.asmx/entranceExitFlow', query, cb);
    },
    getAllFloorsFlow(query, cb) {
        CallApi('PlazaReport.asmx/allFloorsFlow', query, cb);
    },
    getAllPatternsFlow(query, cb) {
        CallApi('PlazaReport.asmx/allPatternsFlow', query, cb);
    },
    getAllBrandsFlow(query, cb) {
        CallApi('PlazaReport.asmx/allBrandsFlow', query, cb);
    }

}